import { PropertiesPanelView } from '../useapi';
import { DefineComponent } from 'vue';

export interface FlowDesign {
	globalColor: string;
	setting: Setting;
	openRule: boolean;
}

export interface FlowSelected {
	name: string; //点击节点时的当前节点名称
	propertiesPanel?: PropertiesPanelView; //面板相关的参数
	items?: Array<FlowSelected>;
}

export interface Setting {
	describe: string;
	grid: {
		open: boolean;
		type: string;
		size: number;
		color?: string;
	};
	backgroundColor?: string;
}

export interface Config {
	type: string;
	text: string;
	content: string;
	icon: string;
	component?: DefineComponent<{}, {}, any>; //面板组件
	items?: Array<Config>;
	formList?: Array<FormItem>;
	formModel?: { name: string; debugMode?: Boolean; script?: string };
}

export interface Group {
	name: string;
	icon: string;
	components: Array<Config>;
	order: number;
}

export interface FormItem {
	label: string;
	field: string;
	type?: string;
	rules?: any; // ?
	javaScriptFunName?: string;
}
